<template>
	<view v-if="type == 1">
		<view class="cu-w-100 cu-position-relative cu-ovr-hdn" :style="[getBackgroundStyle]">
			<slot></slot>
		</view>
	</view>
</template>

<script>
	let vk = uni.vk;
	export default {
		props: {
			type: {
				type: Number,
				default: 1
			},
			backgroundStyle: {
				type: Object,
				default:{
					"height":"180px",
					"padding-top": "40rpx",
					"border-radius" : "0 0 5% 5%",
					"color": "#FFF"
				}
			}
		},
		data() {
			return {
				main: vk.getVuex('$app.color.main'),
				secondary: vk.getVuex('$app.color.secondary'),
			};
		},
		computed:{
			getBackgroundStyle(){
				let style = {};
				style.background = "linear-gradient(45deg, " + this.main + ", " + this.secondary + ")";
				// 合并用户传递的背景色对象
				Object.assign(style, this.backgroundStyle);
				return style;
			}
		}
	}
</script>

<style lang="scss">
	
</style>
